<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>滴滴法律</title>
	<link rel="stylesheet" type="text/css" href="css/normalize.css">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<!--[if lt IE 9]> 
		<script> src="js/html5shiv.min.js"></script> 
	<![endif]-->
	</style>
</head>
<body>
	<div class="well well-sm">律师管理 / 已审核律师</div>
	<form class="form-inline" style="margin:20px;" action="lawyer/search" method="post">
	  <div class="form-group">
	    <label for="field">领域：</label>
	    <select class="form-control" name="serviceType" id="serviceType">
	    	<option value="0">全部</option>
	    	<c:forEach items="${serviceTypes}" var="serviceTypes">
	    		<option value="${serviceTypes.serviceid}" <c:if test="${serviceTypes.serviceid == serviceId}">selected="selected"</c:if>>${serviceTypes.name}</option>
	    	</c:forEach>
	    </select>
	  </div>
	  <div class="form-group">
	    <label for="region">地域：</label>
	    <select class="form-control" name="region" id="region">
	    	<option value="0">全部</option>
	    	<c:forEach items="${provinces}" var="provinces">
	    		<option value="${provinces.provinceId}" <c:if test="${provinces.provinceId == region}">selected="selected"</c:if>>${provinces.province}</option>
	    	</c:forEach>
	    </select>
	  </div>

	  <div class="form-group">
	    <label for="work-years">工龄：</label>
	    <select class="form-control" name="workYears" id="work-years">
	    	<option value="0">全部</option>
	    	<option value="1" <c:if test="${workYears == 1}">selected="selected"</c:if>>5年以下</option>
	    	<option value="2" <c:if test="${workYears == 2}">selected="selected"</c:if>>5~10年</option>
	    	<option value="3" <c:if test="${workYears == 3}">selected="selected"</c:if>>10年以上</option>
	    </select>
	    
	  </div>
	  <button type="submit" class="btn btn-primary">查询</button>
	</form>
	<table class="table table-striped table-hover">
		<thead>
			<tr>
				<th>编号</th>
				<th>姓名</th>
				<th>手机号</th>
				<th>擅长领域</th>
				<th>所在地</th>
				<th>工龄</th>
				<th>创建时间</th>
				<th>状态</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="lawyers" items="${lawyers}">
			<tr>
				<td>${lawyers.lawyerid}</td>
				<td>${lawyers.name}</td>
				<td>${lawyers.username}</td>
				<td>${lawyers.specialNameA},${lawyers.specialNameB},${lawyers.specialNameC}</td>
				<td>${lawyers.provinceName}</td>
				<td>${lawyers.membership}年</td>
				<td><fmt:formatDate value="${lawyers.modifyTime}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
				<td>
					<c:choose>
						<c:when test="${lawyers.state == 1}">
							<input type="button" class="btn btn-warning btn-xs" value="已冻结">
						</c:when>
						<c:otherwise>
							<a href="lawyer/freeze/${lawyers.lawyerid}"><input type="button" class="btn btn-danger btn-xs" value="冻结"></a>
						</c:otherwise>
					</c:choose>
					<a href="lawyer/detail/${lawyers.lawyerid}"><input type="button" class="btn btn-info btn-xs" value="详情"></a>
				</td>										
			</tr>
			</c:forEach>
			
		</tbody>
	</table>
	<!-- 分页 -->
	<nav>
	  <div style="width:235px;margin:0 auto;">
	  	<ul class="pagination">
		    <li>
		      <a href="#" aria-label="Previous">
		        <span aria-hidden="true">«</span>
		      </a>
		    </li>
		    <li class="active"><a href="#">1</a></li>
		    <li><a href="#">2</a></li>
		    <li><a href="#">3</a></li>
		    <li><a href="#">4</a></li>
		    <li><a href="#">5</a></li>
		    <li>
		      <a href="#" aria-label="Next">
		        <span aria-hidden="true">»</span>
		      </a>
		    </li>
		  </ul>
	  </div>
	</nav>
</body>
<script type="text/javascript">
	/* $('#serviceType').change(function() {
		alert($('#serviceType').val());
	});
	
	$('#region').change(function() {
		alert($('#region').val());
	});
	
	$('#work-years').change(function() {
		alert($('#work-years').val());
	}); */


</script>
</html>